@extends('layouts.master3')
@section('content')
<?php
use App\Utils;
?>
<div class="container main">
    <!-- 左边D3-->
    <div class="pull-left col-lg-8 l d3">
<link rel="stylesheet" href="/css/tree.css">
<script>
window['nodes']=[
<?php
foreach($tasks as $task)
{
if($task->x!=0)
{
   $str='fixed: true,x: '.$task->x.',y: '.$task->y."";
}
else $str="";
if($solve[$task->id]==1)
echo "{id:".$task->id.",name: '".$task->title."', reflexive: false,".$str."},\n";
else if($solve[$task->id]==2)
echo "{id:".$task->id.",name: '".$task->title."', reflexive: true,".$str."},\n";
else 
echo "{id:-1,name: 'none', reflexive: true,fixed: true,x: -100,y: -100},\n";
}
?>
  ];
window['links']=[
<?php
foreach($links as $link)
{
     if($solve[$link->first]!=1)continue;
     echo "{source: nodes[".($link->first-1)."], target: nodes[".($link->second-1)."], left: false, right: true },\n";
}
?>
  ];

</script>
  <script src="/js/d3.js"></script>
  <script src="/js/tree1.js"></script>
    </div>
 <!-- 右边XX-->
    <div class="pull-right col-lg-4 r">
        <!-- 个人信息-->

            <div id="tooltip" class="goog-hovercard popover1 bottom in">
                <div class=" no-hovercard"><div class="profile-card member">
                <div class="upper">
                    <a class="avatar-link" href="/u/update" target="_blank">
                        <img class="avatar avatar-xs" alt="" src="{{auth::user()->avatar->url('thumb')}}">
                        <span class="name">{{Auth::user()->name}}</span>
                    </a>

                    <div class="tagline"><?php if(Auth::user()->company=="")echo "请完善公司信息";else echo Auth::user()->company." ".Auth::user()->title;?></div>
<?php
$arr=explode("|",Auth::user()->location);
if(count($arr)<2)
{
  $pro="请填写省份信息";
  $city="请填写城市信息";
}
else
{
   $pro=$arr[0];
   $city=$arr[1];
}
?>
<!--
                    <div class="personal">
                        <span class="info-wrap">
                            <span class="item" style="border:none;">{{$pro}}</span>
                            <span class="item">{{$city}}</span>
                        </span>
                    </div>
-->
                </div>
                <div class="lower clearfix">
                    <div class="meta">
                        <a class="item" target="_blank" href="/rank">
                            <span class="value">{{Auth::user()->score/100}}</span>
                            <span class="key">分数</span>
                        </a>
                        <a class="item" target="_blank" href="/rank">
                            <span class="value">{{Auth::user()->rank}}</span>
                            <span class="key">排行</span>
                        </a>
                        <a class="item" target="_blank" href="/rank">
                            <span class="value">{{Auth::user()->solveNum}}</span>
                            <span class="key">解题数</span>
                        </a>
                    </div>
                    <div class="operation">
			<a class="zg-btn zg-btn-follow zm-rich-follow-btn" href="/u/update" target="_blank">修改资料</a>
                    </div>
                </div>
            </div>
                </div>
            </div>

       <!-- 任务task-->
        <!-- 任务task-->
        <div class="bor">
            <div class="mytask"><h1>正在攻克的任务</h1></div>
            <div class="panel panel-default" style="">
                <!-- Default panel contents -->
                <!--<div class="panel-heading">Panel heading</div>-->

                <!-- Table -->
                <table class="table">
                    <!--<thead>
                    <tr>
                        <th>题号</th>
                        <th>题目</th>
                        <th>分数</th>

                    </tr>
                    </thead>  -->
                    <tbody>
<?php
foreach($tasks as $task)
{
         if($solve[$task->id]!=2)continue;
?>
                    <tr>
                        <td><a target="_blank" href="/task/{{Utils::id2url($task->id)}}">{{$task->title}}</a></td>
                        <td>{{$task->score/100}}分</td>
                    </tr>
<?php
}
?>
                    </tbody>
                </table>
            </div>

    </div>


</div>
<!-- /.container -->
@endsection


